package com.zpark.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

/**
 * @PackageName: com.zpark.controller
 * @ClassName: RedirectController
 * @Description:
 * @author: RZS
 * @date: 2023/4/10  15:28
 */
@Controller
@RequestMapping("/red")
public class RedirectController {

    @RequestMapping("test1.html")
    public String test1(Model model){
        model.addAttribute("msg", "重定向");

        return "redirect:/demo04.jsp";
    }

    @RequestMapping("/test2.html")
    public ModelAndView test2(){
        ModelAndView view = new ModelAndView();
        view.setViewName("redirect:/demo05.jsp");

        return view;
    }

    @RequestMapping("test3.html")
    public String test03(){
        return "redirect:/add/t3.do";
    }
}
